package com.example.hehecat.yuejian1.mvp.presenter;

import com.example.hehecat.yuejian1.mvp.contract.GameListContract;
import com.example.hehecat.yuejian1.mvp.model.GameListModel;
import com.example.hehecat.yuejian1.mvp.model.bean.GameBean;

import java.util.List;

import rx.Subscriber;

public class GameListPresenter implements GameListContract.Presenter {
    private GameListContract.Model model;
    private GameListContract.View view;

    public GameListPresenter(GameListContract.View view) {
        this.view = view;
        model = new GameListModel();
    }

    @Override
    public void updateAdapterData() {
        model.getAllGameData(new Subscriber<List<GameBean>>() {
            @Override
            public void onCompleted() {

            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(List<GameBean> gameBeans) {
                view.updateAdapterData(gameBeans);
            }
        });
    }
}
